package com.earl.eatbao.commons.dao;

import java.io.Serializable;

import org.springframework.data.domain.PageRequest;
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.repository.PagingAndSortingRepository;

@NoRepositoryBean
public interface BaseRepsitoty<T, ID extends Serializable> extends PagingAndSortingRepository<T, ID>{
	
	/**
	 * 查询所有未删除记录
	 * @return
	 */
	public Iterable<T> findByIsDeleteFalse();

	public Iterable<T> findByIsDeleteFalse(PageRequest pageRequest);

	/**
	 * 通过id查询,并且只能够查询出未删除的数据
	 * @param id
	 */
	public T findUniqueByIdAndIsDeleteFalse(ID id);
	
}

